﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Threading;

namespace ImageAcquisition
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        // We allow only one app in one machine.
        private static Mutex g_mutex = null;

        protected override void OnStartup(StartupEventArgs e)
        {
            bool result = false;
            g_mutex = new Mutex(true, "NetGames_Admin_Mutex", out result);
            if (false == result)
            {
                MessageBox.Show("程序已经启动！", "警告");
                this.Shutdown();
            }

            base.OnStartup(e);
        }
    }
}
